package com.kaifamiao.N0716;

import java.util.Random;
import java.util.Scanner;

public class note3 {
    public static void main(String[] args) {

        Random random = new Random();
        int robot = random.nextInt(3);

        System.out.println("请猜拳：0 布 1 石头 2 剪刀 ");
        Scanner sc = new Scanner(System.in);
        int player = sc.nextInt();

        if (player == 0) {
            if (robot == 1) {
                System.out.println("您赢了 对方出了石头" + robot);
            } else if (player == robot) {
                System.out.println("平局");
            } else {
                System.out.println("您输了 对方出了剪刀" + robot);
            }
        }

        if (player == 1) {
             if (robot == 0) {
                 System.out.println("您输了 对方出了布" + robot);
             } else if (player == robot) {
                 System.out.println("平局");
             } else {
                 System.out.println("您赢了 对方出了剪刀" + robot);
             }
        }

        if (player == 2) {
            if (robot == 0) {
                System.out.println("您赢了 对方出了布" + robot);
            } else if (player == robot) {
                System.out.println("平局");
            } else {
                System.out.println("您输了 对方出了剪刀" + robot);
            }
        }
    }
}


